home *** CD-ROM | disk | FTP | other *** search
/ PC Home 49 / PC_Home_Issue_49.iso / lldemo / lldemo.shr / ROSETTA.EXE / ROSETTA.DXR / 00581_picture loading scripts.ls < prev    next >
Encoding:
Text File  |  1996-06-24  |  2.5 KB  |  93 lines

  1. global gQList
  2.  
  3. on getQuadBase which
  4.   set q to getAt(gQList, which)
  5.   return getaProp(q, #base)
  6. end
  7.  
  8. on initQuads
  9.   global gCurQuad, gNexQuad
  10.   set gQList to []
  11.   repeat with i = 1 to 2
  12.     add(gQList, [#base: 449 + ((i - 1) * 4), #page: i, #index: 0, #unit: 0, #chapter: 0])
  13.   end repeat
  14.   set gCurQuad to 1
  15.   set gNexQuad to 2
  16. end
  17.  
  18. on ChangeQuadPtr
  19.   global gCurQuad, gNexQuad
  20.   set temp to gCurQuad
  21.   set gCurQuad to gNexQuad
  22.   set gNexQuad to temp
  23. end
  24.  
  25. on isQuadPageThis which, theUnit, theChap, thePage
  26.   set q to getAt(gQList, which)
  27.   set p to getaProp(q, #page)
  28.   set u to getaProp(q, #unit)
  29.   set c to getaProp(q, #chapter)
  30.   if (theUnit = u) and (theChap = c) and (thePage = p) then
  31.     return 1
  32.   else
  33.     return 0
  34.   end if
  35. end
  36.  
  37. on newPage which, theUnit, theChap, thePage
  38.   if isQuadPageThis(which, theUnit, theChap, thePage) = 0 then
  39.     set q to getAt(gQList, which)
  40.     setaProp(q, #unit, theUnit)
  41.     setaProp(q, #chapter, theChap)
  42.     setaProp(q, #page, thePage)
  43.     setaProp(q, #index, 0)
  44.   end if
  45. end
  46.  
  47. on getPict which
  48.   global gPathList, gCurQuad, gNexQuad, gPatch, gNextPathList, gEsPatch
  49.   set ret to 1
  50.   if pictMode() <> #notUsed then
  51.     if which then
  52.       set q to getAt(gQList, gCurQuad)
  53.       set thePath to gPathList
  54.     else
  55.       set q to getAt(gQList, gNexQuad)
  56.       set thePath to gNextPathList
  57.     end if
  58.     if getaProp(q, #index) < 4 then
  59.       setaProp(q, #index, getaProp(q, #index) + 1)
  60.       set index to getaProp(q, #index) + ((getaProp(q, #page) - 1) * 4)
  61.       if gPatch and (index = 36) then
  62.         set the picture of cast (getaProp(q, #base) + getaProp(q, #index) - 1) to the picture of cast 447
  63.       else
  64.         if gEsPatch and (index = 18) then
  65.           set the picture of cast (getaProp(q, #base) + getaProp(q, #index) - 1) to the picture of cast "ES031018.PCT"
  66.         else
  67.           set fname to makeImagePath(thePath, #PICT, index)
  68.           set fcast to getaProp(q, #base) + getaProp(q, #index) - 1
  69.           set the fileName of cast fcast to fname
  70.           preLoadCast(fcast)
  71.         end if
  72.       end if
  73.     end if
  74.   end if
  75.   return ret
  76. end
  77.  
  78. on checkLoad
  79.   global gCurQuad, gPage, gNewChap
  80.   set q to getAt(gQList, gCurQuad)
  81.   if isQuadPageThis(gCurQuad, ChapStr2Unit(gNewChap), ChapStr2Chap(gNewChap), gPage) = 0 then
  82.     ChangeQuadPtr()
  83.     newPage(gCurQuad, ChapStr2Unit(gNewChap), ChapStr2Chap(gNewChap), gPage)
  84.     set q to getAt(gQList, gCurQuad)
  85.   end if
  86.   set curIndex to getaProp(q, #index)
  87.   if curIndex < 4 then
  88.     repeat with i = curIndex + 1 to 4
  89.       getPict(1)
  90.     end repeat
  91.   end if
  92. end
  93.